﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ERP_PerOutQuery.aspx.cs" Inherits="CRM_Store_ERP_PerOutQuery" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>个人出库查询</title>
    <link href="../css/PageStyle.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../JavaScript/Common.js"></script>
    <script type="text/javascript">
        function getState(value) {
            if (value == 2) {
                return "<font color='red'> 已完成 </font>";
            }
            return value;
        }
        function getType(value) {
            if (value == 1) {
                return "<font color='red'> 借出单 </font>";
            }
            if (value == 2) {
                return "<font color='red'> 借还单 </font>";
            }
            return "<font color='red'> 未定义 </font>";
        }
    </script>
</head>
<body>
    <ext:ResourceManager ID="ResourceManager1" runat="server" AjaxViewStateMode="Enabled" />
    <form id="form1" runat="server">
    <ext:Viewport ID="Viewport1" runat="server" Layout="FitLayout" >
        <Content>
            <ext:Panel runat="server" Border="false" Layout="RowLayout">
                <Items>
                    <ext:FormPanel ID="searchForm" runat="server" Border="false" Padding="5" Height="127">
                        <Content>
                            <ext:FieldSet runat="server" Title="查询条件" Border="true" Layout="ColumnLayout" Header="true" Height="114">
                                <Items>
                                    <ext:Container runat="server" Layout="FormLayout" LabelAlign="Right" ColumnWidth="0.33">
                                        <Items>
                                            <ext:ComboBox ID="extcomb_STOREROOM_ID" runat="server" FieldLabel="库房名称" AnchorHorizontal="0.95" Editable="false" ValueField="STOREROOM_ID" DisplayField="STOREROOM_NAME" TabIndex="1">
                                                <Store>
                                                    <ext:Store ID="Store_Rome" runat="server">
                                                        <Reader>
                                                            <ext:JsonReader IDProperty="STOREROOM_ID">
                                                                <Fields>
                                                                    <ext:RecordField Name="STOREROOM_ID" />
                                                                    <ext:RecordField Name="STOREROOM_NAME" />
                                                                </Fields>
                                                            </ext:JsonReader>
                                                        </Reader>
                                                    </ext:Store>
                                                </Store>
                                            </ext:ComboBox>
                                            <ext:TextField runat="server" ID="exttxtf_CargoName" FieldLabel="商品名称" AnchorHorizontal="0.95" TabIndex="5" />
                                            <ext:ComboBox runat="server" ID="extcomb_BUSINESSTYPE" FieldLabel="业务类型" AnchorHorizontal="0.95" TabIndex="8">
                                                <Items>
                                                    <ext:ListItem Text="全部" Value="0" />
                                                    <ext:ListItem Text="借出" Value="1" />
                                                    <ext:ListItem Text="借还" Value="2" />
                                                </Items>
                                            </ext:ComboBox>
                                        </Items>
                                    </ext:Container>
                                    <ext:Container runat="server" Layout="FormLayout" LabelAlign="Right" ColumnWidth="0.33">
                                        <Items>
                                            <ext:ComboBox runat="server" ID="extcomb_USER"  FieldLabel="销售人员" DisplayField="USER_NAME" ValueField="USER_ID" TabIndex="2" AnchorHorizontal="0.95">
                                                <Store>
                                                    <ext:Store runat="server" ID="Store_USER" AutoLoad="true">
                                                        <Reader>
                                                            <ext:JsonReader IDProperty="USER_ID">
                                                                <Fields>
                                                                    <ext:RecordField Name="USER_ID" />
                                                                    <ext:RecordField Name="USER_NAME" />
                                                                </Fields>
                                                            </ext:JsonReader>
                                                        </Reader>
                                                    </ext:Store>
                                                </Store>
                                            </ext:ComboBox>
                                            <ext:TextField runat="server" ID="exttxtf_CargoCode" FieldLabel="商品代码" AnchorHorizontal="0.95" TabIndex="6" />
                                        </Items>
                                    </ext:Container>
                                    <ext:Container runat="server" Layout="FormLayout" LabelAlign="Right" ColumnWidth="0.33">
                                        <Items>
                                            <ext:CompositeField ID="CompositeField1" runat="server" AnchorHorizontal="0.95" FieldLabel="时间区间">
                                                <Items>
                                                    <ext:DateField ID="extdate_start" Vtype="daterange" runat="server" Flex="1" TabIndex="3">
                                                        <Listeners>
                                                            <Render Handler="this.endDateField = '#{extdate_end}'" />
                                                        </Listeners>
                                                    </ext:DateField>
                                                    <ext:Label ID="Label1" runat="server" Text="到" StyleSpec=" padding-top:3px;">
                                                    </ext:Label>
                                                    <ext:DateField ID="extdate_end" Vtype="daterange" runat="server" Flex="1" TabIndex="4">
                                                        <Listeners>
                                                            <Render Handler="this.startDateField = '#{extdate_start}'" />
                                                        </Listeners>
                                                    </ext:DateField>
                                                </Items>
                                            </ext:CompositeField>
                                            <ext:TextField runat="server" ID="exttxtf_LendNo" FieldLabel="业务单号" AnchorHorizontal="0.95" TabIndex="7" />
                                            <ext:Container ID="Container1" runat="server" Layout="ColumnLayout">
                                                <Items>
                                                    <ext:Panel ID="Panel2" runat="server" Height="25" AnchorHorizontal="0.95" Border="false" ButtonAlign="Right">
                                                        <Content>
                                                            <table width="100%">
                                                                <tr style="width: 100%">
                                                                    <td align="right">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                                    </td>
                                                                    <td align="right" width="50%">
                                                                        <ext:Button ID="extBtn_Search" runat="server" Text="查询" Icon="Find">
                                                                            <Listeners>
                                                                                <Click Handler="gridPanel_listdata.reload();" />
                                                                            </Listeners>
                                                                        </ext:Button>
                                                                    </td>
                                                                    <td align="right">&nbsp;&nbsp;&nbsp;&nbsp;
                                                                    </td>
                                                                    <td align="left" width="50%">
                                                                        <ext:Button ID="extBtn_Clear" runat="server" Text="清空" Icon="BasketDelete">
                                                                            <Listeners>
                                                                                <Click Handler="searchForm.reset();" />
                                                                            </Listeners>
                                                                        </ext:Button>
                                                                    </td>
                                                                </tr>
                                                            </table>
                                                        </Content>
                                                    </ext:Panel>
                                                </Items>
                                            </ext:Container>
                                        </Items>
                                    </ext:Container>
                                </Items>
                            </ext:FieldSet>
                        </Content>
                    </ext:FormPanel>
                    <ext:GridPanel runat="server" ID="gridPanel_listdata" RowHeight="1" BodyStyle="border-width:1 0 0 0;" AutoScroll="true" TrackMouseOver="true" StripeRows="true">
                        <ColumnModel>
                            <Columns>
                                <ext:RowNumbererColumn Header="<center>序号</center>" Width="35" />
                                <ext:Column Header="<center>库房</center>" Width="150" DataIndex="STOREROOM_NAME" />
                                <ext:Column Header="<center>销售员</center>" Width="150" DataIndex="SALER" />
                                <ext:Column Header="<center>业务单号</center>" Width="150" DataIndex="BUSINESSNO" />
                                <ext:Column Header="<center>业务类型</center>" Width="150" DataIndex="BUSINESSTYPE">
                                    <Renderer Fn="getType" />
                                </ext:Column>
                                <ext:Column Header="<center>商品名称</center>" Width="130" DataIndex="CargoName" />
                                <ext:Column Header="<center>商品代码</center>" Width="100" DataIndex="CargoCode" />
                                <ext:Column Header="<center>规格</center>" Width="125" DataIndex="Spec"/>
                                <ext:Column Header="<center>型号</center>" Width="150" DataIndex="Version" />
                                <ext:Column Header="<center>产地</center>" Width="120" DataIndex="Area" />
                                <ext:Column Header="<center>生产厂家</center>" Width="125" DataIndex="ProduceName"/>
                                <ext:Column Header="<center>批号</center>" Width="150" DataIndex="BatchNo" />
                                <ext:Column Header="<center>供应价格</center>" Width="100" DataIndex="Supplyprice" />
                                <ext:Column Header="<center>数量</center>" Width="100" DataIndex="Count"/>
                                <ext:Column Header="<center>总金额</center>" Width="150" DataIndex="SumPrice" />
                                <ext:Column Header="<center>状态</center>" Width="100" DataIndex="State">
                                    <Renderer Fn="getState" />
                                </ext:Column>
                            </Columns>
                        </ColumnModel>
                        <Store>
                            <ext:Store runat="server" ID="Store1" OnRefreshData="MyData_Refresh">
                                <Reader>
                                    <ext:JsonReader>
                                        <Fields>
                                            <ext:RecordField Name="BUSINESSNO" />
                                            <ext:RecordField Name="StoreRoomId"/>
                                            <ext:RecordField Name="Owner" />
                                            <ext:RecordField Name="InDate" />
                                            <ext:RecordField Name="Count" />
                                            <ext:RecordField Name="BUSINESSTYPE" />
                                            <ext:RecordField Name="State"/>
                                            <ext:RecordField Name="STOREROOM_NAME"/>
                                            <ext:RecordField Name="SALER" />
                                            <ext:RecordField Name="Supplyprice" />
                                            <ext:RecordField Name="CargoName" />
                                            <ext:RecordField Name="CargoCode" />
                                            <ext:RecordField Name="Spec" />
                                            <ext:RecordField Name="Version"  />
                                            <ext:RecordField Name="Area" />
                                            <ext:RecordField Name="ProduceName" />
                                            <ext:RecordField Name="BatchNo"/>
                                            <ext:RecordField Name="SumPrice" />
                                        </Fields>
                                    </ext:JsonReader>
                                </Reader>
                            </ext:Store>
                        </Store>
                        <SelectionModel>
                            <ext:RowSelectionModel runat="server" SingleSelect="true" />
                        </SelectionModel>
                        <BottomBar>
                            <ext:PagingToolbar runat="server" ID="PagingToolbar1" PageSize="20" DisplayInfo="true"
                                Height="25" DisplayMsg="显示{0} - {1},共{2}条" EmptyMsg="没有可显示的记录" StateID="Store1" />
                        </BottomBar>
                    </ext:GridPanel>
                </Items>
            </ext:Panel>
        </Content>
    </ext:Viewport>
    </form>
</body>
</html>
